Headcannon Game Engine Script Commands - Level Control
Index:
Miscellaneous:
(D) (E) | _LevelActivation |
(D) (E) | _SetLevel |
(D) (E) | _BoundaryEvent_Abort |
(D) (E) | _ForceLoad_Act |
(D) (E) | _ForceLoad_Zone |
Viewport Control:
(D) (E) | _VPX_Move |
(D) (E) | _VPY_Move |
(D) (E) | _VPX_Set |
(D) (E) | _VPY_Set |
(D) (E) | _Player_SetTargetBounds |
Level Manipulation:
(D) (E) | _Plane_Show |
(D) (E) | _Plane_Show_OneScreen |
(D) (E) | _Plane_CopySection |
Plane Data Retrieval:
(D) (E) | _Reg=TileInfo(Reg) |
(D) (E) | _Reg=TileInfo(Chr) |
(D) (E) | _Reg=TileInfo(Obj) |
(D) (E) | _Reg=TileInfo(Chr_Hotspot) |
(D) (E) | _Reg=TileInfo(Obj_Hotspot) |
(D) (E) | _Chr=TileInfo(Reg) |
(D) (E) | _Chr=TileInfo(Chr) |
(D) (E) | _Chr=TileInfo(Obj) |
(D) (E) | _Chr=TileInfo(Chr_Hotspot) |
(D) (E) | _Chr=TileInfo(Obj_Hotspot) |
(D) (E) | _Obj=TileInfo(Reg) |
(D) (E) | _Obj=TileInfo(Chr) |
(D) (E) | _Obj=TileInfo(Obj) |
(D) (E) | _Obj=TileInfo(Chr_Hotspot) |
(D) (E) | _Obj=TileInfo(Obj_Hotspot) |
(D) (E) | _Reg=TiledObjInfo(Reg) |
(D) (E) | _Reg=TiledObjInfo(Chr) |
(D) (E) | _Reg=TiledObjInfo(Obj) |
(D) (E) | _Reg=TiledObjInfo(Chr_Hotspot ) |
(D) (E) | _Reg=TiledObjInfo(Obj_Hotspot ) |
(D) (E) | _Chr=TiledObjInfo(Reg) |
(D) (E) | _Chr=TiledObjInfo(Chr) |
(D) (E) | _Chr=TiledObjInfo(Obj) |
(D) (E) | _Chr=TiledObjInfo(Chr_Hotspot ) |
(D) (E) | _Chr=TiledObjInfo(Obj_Hotspot ) |
(D) (E) | _Obj=TiledObjInfo(Reg) |
(D) (E) | _Obj=TiledObjInfo(Chr) |
(D) (E) | _Obj=TiledObjInfo(Obj) |
(D) (E) | _Obj=TiledObjInfo(Chr_Hotspot ) |
(D) (E) | _Obj=TiledObjInfo(Obj_Hotspot ) |
(D) (E) | _TiledObj_GetMapFromPlane |
Plane Effects:
(D) (E) | _Plane_SetEffectFunc |
(D) (E) | _Plane_AdjustThatParalax(RegL,RegP,RegO) |
(D) (E) | _Plane_AdjustThatParalax(RegL,RegP,ConstO) |
(D) (E) | _Plane_AdjustThatParalax(RegL,ConstP,RegO) |
(D) (E) | _Plane_AdjustThatParalax(RegL,ConstP,ConstO) |
(D) (E) | _Plane_AdjustThatParalax(ConstL,RegP,RegO) |
(D) (E) | _Plane_AdjustThatParalax(ConstL,RegP,ConstO) |
(D) (E) | _Plane_AdjustThatParalax(ConstL,ConstP,RegO) |
(D) (E) | _Plane_AdjustThatParalax(ConstL,ConstP,ConstO) |
(D) (E) | _Plane_AdjustThatSingle(RegL,RegO) |
(D) (E) | _Plane_AdjustThatSingle(RegL,ConstO) |
(D) (E) | _Plane_AdjustThatSingle(ConstL,RegO) |
(D) (E) | _Plane_AdjustThatSingle(ConstL,ConstO) |
(D) (E) | _Plane_AdjustThisParalax(RegP,RegO) |
(D) (E) | _Plane_AdjustThisParalax(RegP,ConstO) |
(D) (E) | _Plane_AdjustThisParalax(ConstP,RegO) |
(D) (E) | _Plane_AdjustThisParalax(ConstP,ConstO) |
(D) (E) | _Plane_AdjustThisSingle(RegO) |
(D) (E) | _Plane_AdjustThisSingle(ConstO) |
Descriptions:
Miscellaneous:
_LevelActivation
(ALL) (Example)
Toggles "Level Freezing" by modifying both the FreezeObjects
Register and the Player_Freeze for both Players, causing
the processing of Objects, Players,
Tile Animation, and
Palette Animation to be suspended or resumed.
Status Objects and "Game"/"Zone"/"Act" Functions will remain active.
Parameters:
- Flag
0- Suspended, FreezeObjects set to 65535 and Player_Freeze set to 1
1- Active, FreezeObjects and Player_Freeze both set to 0
_SetLevel
(ALL) (REG) (Example)
Changes the current level by setting the current "Zone" and "Act", and changing
the "InLevel" Register to 0 to trigger level init.
The "R" or "r" tags may be used to obtain a value from a Register for either Parameter.
Parameters:
_BoundaryEvent_Abort
(FUNC) (Example)
Stops a Function working as a Boundary Event Function, and instructs the
"Current Player" not to set its Player_Curr_Boundary variable equal to that Event's ID.
This is useful when Boundary
Events should only be activated under certain conditions, enabling the
Boundary and condition to be tested again during the next Game Frame. If the
"_Stop_Current_Function" Command is used instead, the player will receive
the Boundary's ID, causing the Boundary not to be tested again until a
different Event is triggered first
Parameters:
None
_ForceLoad_Act
_ForceLoad_Zone
(FUNC) (Example)
These Commands immediately force the data referenced by a "zone.def" file to be re-loaded as if the
"_SetLevel" Command had been used, but without causing other effects of the Command, such
as the automatic clearing of all Objects, ceasing of all active Functions, and the calling of an "Act Init Function".
In the case of the "_Act" variant, only data for the "Act" is loaded; "Zone" data otherwise remains the same. When the "_Zone"
variant is used, both "Zone" and "Act" data are loaded.
This is useful if any of this data has been somehow modified for the current level, or if a "chaining" effect is desired
between levels, such that levels appear to bleed seamlessly into one-another without causing a fade-out, but is only
necessary when switching between "Zone"s that use unique data sets, or if "Act"s within the same Zone use their own
unique datasets.
When an effect such as the chaining of separate levels is desired, the "_zone" and "_act" Registers must be changed manually
before either of these Commands are used. If this is not done, these Commands will re-load data for the current Zone/Act.
Parameters:
None
Viewport Control:
_VPX_Move
_VPY_Move
(ALL) (Example)
These Commands add a value to the X or Y positions of both "ViewPorts".
They aren't effective when a Player Movement Object is active,
and its corresponding Player is flagged for Automatic Viewport Update.
The usefulness of these Commands is limited, and has been superceded by the ability to directly modify the "ViewPort" Registers.
Parameters:
- Num of Pixels
This value specifies how far to move the "ViewPort", in pixels
_VPX_Set
_VPY_Set
(ALL) (Example)
These Commands set the X or Y positions of both "ViewPorts".
They aren't effective when a Player Movement Object is active,
and its corresponding Player is flagged for Automatic Viewport Update.
The usefulness of these Commands is limited, and has been superceded by the ability to directly modify the "Viewport" Registers.
Parameters:
- Position
New position at which to set the "ViewPorts"
_Player_SetTargetBounds
(ALL) (REG) (Example)
Sets the Target Level Boundaries for the specified player.
The Player and his
Camera cannot move outside of these boundaries if Level Section Looping is not
active, and if they differ from the current boundaries, the screen will scroll
until they are met.
If Level Section Looping is active, the boundaries set by
this Command will serve as the start and end points of the looping segment.
This Command will also automatically update the size of the current level
section, which is absolutely necesary when looping is active.
Parameters:
- Player ID
ID number of the Player who's Boundaries will be set.
The "R" or "r" tags
may be used to obtain a value from a Register.
The "Curr_Player"
Register may be used if this Command is called from within a Player Function
or during a "Boundary Event",
otherwise it may not have the desired effect.
- Bound X1
- Bound Y1
- Bound X2
- Bound Y2
These values give the new boundary positions to set for the given player.
The "R" or "r" tags
may be used to obtain a value from a Register for each of these values.
Level Manipulation:
_Plane_Show
(ALL) (Example)
Enables or disables visibility of a Tile Plane on both Players' screens.
To toggle a Tile Plane's visibility on only one Player's screen, use _Plane_Show_OneScreen
For a Tile Plane to be visible,
a Tile Plane Object must have been spawned using that Plane's
ID. Flagging the Plane with this Command does not create or destroy
a Tile Plane Object, it simply toggles the visibility of an existing one. If an
Object for the desired plane does not exist, this Function will have no effect.
Parameters:
- Plane ID
ID number of the tile plane to toggle
- Visibility
The Tile Plane's visibility state:
0- Invisible
1- Visible
_Plane_Show_OneScreen
(ALL) (Example)
Enables or disables visibility of a Tile Plane on one Player's screen.
To toggle a Tile Plane's visibility on both Players' screens, use _Plane_Show
For a Tile Plane to be visible,
a Tile Plane Object must have been spawned using that Plane's
ID. Flagging the Plane with this Command does not create or destroy
a Tile Plane Object, it simply toggles the visibility of an existing one. If an
Object for the desired plane does not exist, this Function will have no effect.
Parameters:
- Plane ID
ID number of the tile plane to toggle
- Player ID
ID number of the player for whose screen the Plane should be toggled.
The "R" or "r" tags
may be used to obtain a value from a Register, including the "Curr_Player" Register.
- Visibility
The Tile Plane's visibility state:
0- Invisible
1- Visible
_Plane_CopySection
(ALL) (REG) (Example)
Copies a rectangular region of Tile data of the specified size from one portion
of a Tile Plane to another. If scroll data exists for either plane, it is left
unaffected.
The "R" or "r" tags
may be used to obtain a value from a Register for any of the Parameters.
Parameters:
- Source Plane ID
ID number of the source Tile Plane from which to copy.
- Source X
- Source Y
Starting X and Y position of the top-left Tile of the source region.
This is measured in Tiles, not pixels.
- Dest Plane ID
ID number of the Destination Tile Plane where the data should be pasted.
- Dest X
- Dest Y
Starting X and Y position of the top-left tile at which to paste the data.
This is measured in Tiles, not pixels.
- Width
- Height
The width and height of the Tile area that should be copied.
This is measured in Tiles, not pixels.
Plane Data Retrieval:
_Reg=TileInfo(Reg)
_Reg=TileInfo(Chr)
_Reg=TileInfo(Obj)
_Reg=TileInfo(Chr_Hotspot)
_Reg=TileInfo(Obj_Hotspot)
_Chr=TileInfo(Reg)
_Chr=TileInfo(Chr)
_Chr=TileInfo(Obj)
_Chr=TileInfo(Chr_Hotspot)
_Chr=TileInfo(Obj_Hotspot)
_Obj=TileInfo(Reg)
_Obj=TileInfo(Chr)
_Obj=TileInfo(Obj)
_Obj=TileInfo(Chr_Hotspot)
_Obj=TileInfo(Obj_Hotspot)
_Reg=TiledObjInfo(Chr)
_Reg=TiledObjInfo(Obj)
_Reg=TiledObjInfo(Chr_Hotspot)
_Reg=TiledObjInfo(Obj_Hotspot)
_Chr=TiledObjInfo(Reg)
_Chr=TiledObjInfo(Chr)
_Chr=TiledObjInfo(Obj)
_Chr=TiledObjInfo(Chr_Hotspot)
_Chr=TiledObjInfo(Obj_Hotspot)
_Obj=TiledObjInfo(Reg)
_Obj=TiledObjInfo(Chr)
_Obj=TiledObjInfo(Obj)
_Obj=TiledObjInfo(Chr_Hotspot)
_Obj=TiledObjInfo(Obj_Hotspot)
(ALL) (Example)
Retrieves the four basic types of data pertaining to any Tile at any point in any
Tile Plane or Tiled Path Object:
- ID of the Tile
- Tile's Floor Type
- Tile's "Angle" Value
- The Solidity at the given pixel point within the Tile's Solidity Map
These values are stored into the given variables.
The "_TiledObj" versions of these Commands attempt to retreive Tile data from the "Current Object".
Parameters:
- Var ID for X Pos
- Var ID for Y Pos
- Var ID for Plane ID
The first two Parameters are the IDs of the variables from which to obtain the X and
Y level coordinates, and the third is the ID of the variable from which to obtain the
ID of the Tile Plane that should be tested. (The "Plane ID" Parameter is present, but ignored when using "TiledObj" versions)
In the case of Hotspots, the X and Y position
Parameters are the ID numbers of the
Hotspot(s) from which to take the X and Y position. This effectively allows the use of
separate Hotspots to obtain X and Y testing coordinates. In this case, the Plane ID
is taken from a variable from the same Object/Player whose Hotspots were used, which
is the Object/Player "Fetched" to "Reference 0".
In the case of "Registers", "Var ID" are the IDs of the "Registers" that contain the X and Y coordinates, and the Plane ID. The "U" tag may be used
to specify a user-defined Register. Otherwise, the ID will refer to a Game Register
In the case of Player Variables, "Var ID" are the IDs of the Player Variables for the Player that is "Fetched" to "Reference 0" that contain the X and Y coordinates, and the Plane ID. The capital "A"
tag may be used to specify an "Active" variable, the lower-case "a" to specify a user-
defined "Active" variable, and the lower-case "c" to specify a user-defined Constant.
Otherwise, the ID will refer to one of the Player's required Constants
In the case of Object Variables, "Var ID" are the IDs of the Object Variables for the Object that is "Fetched" to "Reference 0" that contain the X and Y coordinates, and the Plane ID. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
- Var ID for Tile ID
- Var ID for Floor Type
- Var ID for Slope Type
- Var ID for Solid Type
These Parameters are the IDs of the destination variables which are to receive the data.
All of this data is collected and stored in variables (all
of these Parameters are required), however, a variable that will otherwise not be used
may be given for each value that isn't desired. Unnecessary values do not need to be
stored in unique variables
In the case of "Registers", "Var ID" are the IDs of the "Registers" that should receive the acquired Tile data. The "U" tag may be used
to specify a user-defined Register. Otherwise, the ID will refer to a Game Register
In the case of Player Variables, "Var ID" are the IDs of the Player Variables for the Player that is "Fetched" to "Reference 2" that should receive the acquired Tile data. The capital "A"
tag may be used to specify an "Active" variable, the lower-case "a" to specify a user-
defined "Active" variable, and the lower-case "c" to specify a user-defined Constant.
Otherwise, the ID will refer to one of the Player's required Constants
In the case of Object Variables, "Var ID" are the IDs of the Object Variables for the Object that is "Fetched" to "Reference 2" that should receive the acquired Tile data. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
_TiledObj_GetMapFromPlane
(ALL) (REG) (Example)
Copies Tile layout data from the given area of the given Tile Plane to the appropriate "Extra Variables" of the Object "Fetched" to "Reference 2". This is used for dynamically creating/updating the layout of a Tiled Path Object; using this Command on any other type of Object will have undesirable results. Width, height, and starting destination variable ID are taken directly from the Object's own settings.
The "R" or "r" tags may be used to obtain a value from a Register for the Tile Plane ID and source X and Y Parameters.
Parameters:
- Source Plane ID
ID number of the Tile Plane from which the layout data should be obtained.
- Source X Offset
- Source Y Offset
X and Y Tile offsets within the given Tile Plane that make up the upper-left corner of the layout section that should be copied to the Object.
Plane Effects:
_Plane_SetEffectFunc
(ALL) (REG) (Example)
Assigns a Function that was loaded by a "Game Def" or "Zone Def"
to a Tile Plane, to be run as its "Effect Function".
This Function will be run just before the Tile Plane is drawn on either active game screen, and would generally
contain _Plane_AdjustThatParalax(Layer?_Paralax?_Offset? Commands for controlling
its scrolling offsets.
The "R" or "r" tags may be used to obtain a value from a Register for either Parameter.
Parameters:
- Plane ID
ID number of the Tile Plane whose "Effect Function" should be set.
- Function ID
ID number of the Function that should be assigned to the given Tile Plane. The "G", "Z", and "A" tags may be used to reference "Game", "Zone", and "Act" Functions, respectively.
_Plane_AdjustThatParalax(RegL,RegP,RegO)
_Plane_AdjustThatParalax(RegL,RegP,ConstO)
_Plane_AdjustThatParalax(RegL,ConstP,RegO)
_Plane_AdjustThatParalax(RegL,ConstP,ConstO)
_Plane_AdjustThatParalax(ConstL,RegP,RegO)
_Plane_AdjustThatParalax(ConstL,RegP,ConstO)
_Plane_AdjustThatParalax(ConstL,ConstP,RegO)
_Plane_AdjustThatParalax(ConstL,ConstP,ConstO)
(ALL) (Example)
These Commands set scrolling offsets for individual rows/colums of the given Tile Plane, depending
on that Plane's type setting.
"Paralax" refers to the X axis on "Horizontal" and "Relative" planes, while for "Vertical" Planes, "Paralax"
sets offsets on the Y axis.
These Commands may be used within "Plane Effect Functions", however, the "_Plane_AdjustThisParalax(Paralax?_Offset?"
Commands exist for manipulating the Plane that is running the Function.
"R" signifies that the ID will be obtained from a "Register, while "C" signifies that a Constant Value should be used to provide the ID.
Parameters:
- Plane
In the case of Registers, this is the ID number of the Register that contains the ID of the Plane to manipulate.
In the case of Constant Values, this is the ID of the Plane to manipulate.
- Row/Column
In the case of Registers, this is the ID number of the Register that contains the ID of the Tile/Pixel Row/Column to offset.
In the case of Constant Values, this is the ID of the Tile/Pixel Row/Column to offset.
- Offset
In the case of Registers, this is the ID number of the Register that contains the offset value to apply to the given Row/Column.
In the case of Constant Values, this is the offset value to apply to the given Row/Column.
_Plane_AdjustThatSingle(RegL,RegO)
_Plane_AdjustThatSingle(RegL,ConstO)
_Plane_AdjustThatSingle(ConstL,RegO)
_Plane_AdjustThatSingle(ConstL,ConstO)
(ALL) (Example)
These Commands set scrolling offsets for individual rows/colums of the given Tile Plane, depending
on that Plane's type setting.
"Single" refers to the Y axis on "Horizontal" and "Relative" planes, while for "Vertical" Planes, "Single"
sets offsets on the X axis.
These Commands may be used within "Plane Effect Functions", however, the "_Plane_AdjustThisSingle(Offset?"
Commands exist for manipulating the Plane that is running the Function.
"R" signifies that the ID will be obtained from a "Register, while "C" signifies that a Constant Value should be used to provide the ID.
Parameters:
- Plane
In the case of Registers, this is the ID number of the Register that contains the ID of the Plane to manipulate.
In the case of Constant Values, this is the ID of the Plane to manipulate.
- Offset
In the case of Registers, this is the ID number of the Register that contains the offset value to apply to the given Row/Column.
In the case of Constant Values, this is the offset value to apply to the given Row/Column.
_Plane_AdjustThisParalax(RegP,RegO)
_Plane_AdjustThisParalax(RegP,ConstO)
_Plane_AdjustThisParalax(ConstP,RegO)
_Plane_AdjustThisParalax(ConstP,ConstO)
(PLANE EFFECT) (Example)
These Commands set scrolling offsets for individual rows/colums of the Tile Plane that is running
the Plane Effect Function that uses them, depending on that Plane's type setting.
"Paralax" refers to the X axis on "Horizontal" and "Relative" planes, while for "Vertical" Planes, "Paralax"
sets offsets on the Y axis.
"R" signifies that the ID will be obtained from a "Register, while "C" signifies that a Constant Value should be used to provide the ID.
Parameters:
- Row/Column
In the case of Registers, this is the ID number of the Register that contains the ID of the Tile/Pixel Row/Column to offset.
In the case of Constant Values, this is the ID of the Tile/Pixel Row/Column to offset.
- Offset
In the case of Registers, this is the ID number of the Register that contains the offset value to apply to the given Row/Column.
In the case of Constant Values, this is the offset value to apply to the given Row/Column.
_Plane_AdjustThisSingle(RegO)
_Plane_AdjustThisSingle(ConstO)
(PLANE EFFECT) (Example)
These Commands set scrolling offsets for individual rows/colums of the Tile Plane that is running
the Plane Effect Function that uses them, depending on that Plane's type setting.
"Single" refers to the Y axis on "Horizontal" and "Relative" planes, while for "Vertical" Planes, "Single"
sets offsets on the X axis.
"R" signifies that the ID will be obtained from a "Register, while "C" signifies that a Constant Value should be used to provide the ID.
Parameters:
- Offset
In the case of Registers, this is the ID number of the Register that contains the offset value to apply to the given Row/Column.
In the case of Constant Values, this is the offset value to apply to the given Row/Column.
Examples:
#_LevelActivation ;Suspend Object, Player, and Tile/Palette Animation Processing
:_Off
; ----------
#_LevelActivation ;Resume Object, Player, and Tile/Palette Animation Processing
:_On
_SetLevel
(Description)
#_SetLevel ;Load and run Zone 7, Act 0
: 7 ;(Zone) Zone 7
: 0 ;(Act) Act 0
; ----------
#_SetLevel ;Load and run the level whose Zone and Act IDs are stored in "User Registers" 2 and 3, respectively
: R2 ;(Zone) Zone whose ID is stored in "User Register" 2
: R3 ;(Act) Act whose ID is stored in "User Register" 3
_BoundaryEvent_Abort
(Description)
#_BoundaryEvent_Abort ;Exit the Function, and don't allow the Player to take the Boundary's ID, leaving him able to test for this boundary again on the next Game Frame
_ForceLoad_Act
_ForceLoad_Zone
(Description)
#_ForceLoad_Act ;Immediately (re)load "Act" data for the level referenced by the "_zone" and "_act" Registers
; ----------
#_ForceLoad_Zone ;Immediately (re)load "Zone" and "Act" data for the level referenced by the "_zone" and "_act" Registers
Viewport Control:
#_VPX_Move ;Move the X Position of the ViewPorts right by 4 pixels
: 4 ;4 Pixels
; ----------
#_VPY_Move ;Move the Y Position of the ViewPorts up by 2 pixels
: -2 ;2 Pixels
_VPX_Set
_VPY_Set
(Description)
#_VPX_Set ;Set the X Position of the ViewPorts to level position 1024
:1024 ;Level Position 1024
; ----------
#_VPY_Set ;Set the Y Position of the ViewPorts to level position 224
: 224 ;Level Position 224
_Player_SetTargetBounds
(Description)
#_Player_SetTargetBounds ;Set the target level boundaries for the "Current Player" to start at 10592,0 for the upper-left, and 10912,992 for the lower-right
:r_Curr_Player ;(Plyr)
:10592 ;(X1) Horizontal level position 10592 for the left side
: 0 ;(Y1) Vertical level position 0 for the upper side
:10912 ;(X2) Horizontal level position 10912 for the right side
: 992 ;(Y2) Vertical level position 992 for the lower side
; ----------
#_Player_SetTargetBounds ;Set the target X1, Y1, X2, and Y2 level boundaries for Player 1 to the values stored in "User Registers" 4, 5, 6, and 7, respectively
:_Player1 ;(Plyr)
: R4 ;(X1) Value stored in "User Register" 4 for the left side
: R5 ;(Y1) Value stored in "User Register" 5 for the upper side
: R6 ;(X2) Value stored in "User Register" 6 for the right side
: R7 ;(Y2) Value stored in "User Register" 7 for the lower side
Level Manipulation:
#_Plane_Show ;Set Tile Plane 0 as visible for both Players
: 0 ;(ID) Plane 0
:_Visible ;(Toggle)
_Plane_Show_OneScreen
(Description)
#_Plane_Show_OneScreen ;Set Tile Plane 2 as invisible for the "Current Player"
: 2 ;(ID) Plane 2
:r_Curr_Player ;(Player) Current Player
:_Invisible ;(Toggle)
_Plane_CopySection
(Description)
#_Plane_CopySection ;Copy a Tile area of 6x6 from Tile location 36,0 in Plane 1, to Tile location 0,0 in Plane 1
: 1 ;(Src Plane) Plane 1
: 36 ;(Src X) Tile X location 36
: 0 ;(Src Y) Tile Y location 0
: 1 ;(Dest Plane) Plane 1
: 0 ;(Dest X) Tile X location 0
: 0 ;(Dest Y) Tile Y location 0
: 6 ;(Width) 6 Tiles width
: 6 ;(Height) 6 Tiles height
; ----------
#_Plane_CopySection ;Copy a Tile area of size defined by "User Registers" 7 and 8 from Tile location defined by "User Registers" 10 and 11 in the Plane whose ID is stored in "User Register" 9, to Tile location defined by "User Registers" 13 and 14 in the Plane whose ID is stored in "User Register" 12
: R9 ;(Src Plane) Plane whose ID is stored in "User Register" 9
: R10 ;(Src X) Tile X location is the value stored in "User Register" 10
: R11 ;(Src Y) Tile Y location is the value stored in "User Register" 11
: R12 ;(Dest Plane) Plane whose ID is stored in "User Register" 12
: R13 ;(Dest X) Tile X location is the value stored in "User Register" 13
: R14 ;(Dest Y) Tile Y location is the value stored in "User Register" 14
: R7 ;(Width) Width is the value stored in "User Register" 7
: R8 ;(Height) Height is the value stored in "User Register" 7
Plane Data Retrieval:
_Reg=TileInfo(Reg)
_Reg=TileInfo(Chr)
_Reg=TileInfo(Obj)
_Reg=TileInfo(Chr_Hotspot)
_Reg=TileInfo(Obj_Hotspot)
_Chr=TileInfo(Reg)
_Chr=TileInfo(Chr)
_Chr=TileInfo(Obj)
_Chr=TileInfo(Chr_Hotspot)
_Chr=TileInfo(Obj_Hotspot)
_Obj=TileInfo(Reg)
_Obj=TileInfo(Chr)
_Obj=TileInfo(Obj)
_Obj=TileInfo(Chr_Hotspot)
_Obj=TileInfo(Obj_Hotspot)
_Reg=TiledObjInfo(Chr)
_Reg=TiledObjInfo(Obj)
_Reg=TiledObjInfo(Chr_Hotspot)
_Reg=TiledObjInfo(Obj_Hotspot)
_Chr=TiledObjInfo(Reg)
_Chr=TiledObjInfo(Chr)
_Chr=TiledObjInfo(Obj)
_Chr=TiledObjInfo(Chr_Hotspot)
_Chr=TiledObjInfo(Obj_Hotspot)
_Obj=TiledObjInfo(Reg)
_Obj=TiledObjInfo(Chr)
_Obj=TiledObjInfo(Obj)
_Obj=TiledObjInfo(Chr_Hotspot)
_Obj=TiledObjInfo(Obj_Hotspot)
(Description)
#_Reg=TileInfo(Chr) ;Use "Player_X_Pos", User-created "Active Variable 2", and "Player_Solid_Plane" of the Player "Fetched" to "Reference 0" as the X,Y Position and Tile Plane ID from which to obtain Level Tile Data, and store the Tile ID, "Floor Type", "Angle", and Solidity Type into "User Registers" 25, 26, 27, and 28, respectively
: A3 ;(Chr0 X) "Active Variable" 3 (Player_X_Pos) of the Player "Fetched" to "Reference 0"
: a2 ;(Chr0 Y) User-created "Active Variable" 2 of the Player "Fetched" to "Reference 0"
: A28 ;(Chr0 PlaneID) "Active Variable" 28 (Player_Solid_Plane) of the Player "Fetched" to "Reference 0"
: U25 ;(Reg TileID) "User Register" 25
: U26 ;(Reg Floor) "User Register" 26
: U27 ;(Reg Angle) "User Register" 27
: U28 ;(Reg Solid) "User Register" 28
; ----------
#_Chr=TiledObjInfo(Chr_Hotspot) ;Assume the "Current Object" is a Tiled Path Object. From the current Sprite Frame of the Player "Fetched" to "Reference 0", use Hotspot 1 for the X level Position, and Hotspot 2 for the Y level position at which to test against the Object's Tile Map, storing the Tile ID, "Floor Type", "Angle", and Solidity Type From the Tile at that location into User-created "Active Variables" 14, 15, 16, and 17 of the Player "Fetched" to "Reference 2", respectively
: 1 ;(Spot X) Hotspot 1 from the current Sprite Frame of the Player "Fetched" to "Reference 0"
: 2 ;(Spot Y) Hotspot 2 from the current Sprite Frame of the Player "Fetched" to "Reference 0"
: 0 ;Ignored for TiledObject
: a14 ;(Chr2 TileID) User-created "Active Variable" 14 of the Player "Fetched" to "Reference 2"
: a15 ;(Chr2 Floor) User-created "Active Variable" 15 of the Player "Fetched" to "Reference 2"
: a16 ;(Chr2 Angle) User-created "Active Variable" 16 of the Player "Fetched" to "Reference 2"
: a17 ;(Chr2 Solid) User-created "Active Variable" 17 of the Player "Fetched" to "Reference 2"
; ----------
#_Obj=TileInfo(Obj) ;Use "Object_X", "Object_Y", and "Extra Variable" 8 of the Object "Fetched" to "Reference 0" as the X,Y Position and Tile Plane ID from which to obtain Level Tile Data, and store the Tile ID, "Floor Type", "Angle", and Solidity Type into "Extra Variables" 13, 14, 15, and 16 of the Object "Fetched" to "Reference 2", respectively
: 1 ;(Obj0 X) Main Variable 1 (Object_X) of the Object "Fetched" to "Reference 0"
: 2 ;(Obj0 Y) Main Variable 2 (Object_Y) of the Object "Fetched" to "Reference 0"
: E8 ;(Obj0 PlaneID) "Extra Variable" 8 of the Object "Fetched" to "Reference 0"
: E13 ;(Obj2 TileID) "Extra Variable" 13 of the Object "Fetched" to "Reference 2"
: E14 ;(Obj2 Floor) "Extra Variable" 14 of the Object "Fetched" to "Reference 2"
: E15 ;(Obj2 Angle) "Extra Variable" 15 of the Object "Fetched" to "Reference 2"
: E16 ;(Obj2 Solid) "Extra Variable" 16 of the Object "Fetched" to "Reference 2"
_TiledObj_GetMapFromPlane
(Description)
#_TiledObj_GetMapFromPlane ;Copy a Tile area from Tile location 6,2 in Plane 4 to the Tiled Path Object "Fetched" to "Reference 2"
: 4 ;(Src Plane) Plane 4
: 6 ;(Src X) Tile X location 36
: 2 ;(Src Y) Tile Y location 0
; ----------
#_TiledObj_GetMapFromPlane ;Copy a Tile area from the Tile location defined by "User Registers" 12 and 13 in the Plane whose ID is stored in "User Register" 11 to the Tiled Path Object "Fetched" to "Reference 2"
: R11 ;(Src Plane) Plane whose ID is stored in "User Register" 11
: R12 ;(Src X) Tile X location is the value stored in "User Register" 12
: R13 ;(Src Y) Tile Y location is the value stored in "User Register" 13
Plane Effects:
#_Plane_SetEffectFunc ;Assign "Zone" Function 1 as Plane 0's "Effect Function"
: 0 ;(Plane ID) Plane 0
: Z1 ;(Func ID) "Zone" Function 1
; ----------
#_Plane_SetEffectFunc ;Assign the Function whose ID is stored in "User Register 19 as the "Effect Function" for the Plane whose ID is stored in "User Register" 18
: R18 ;(Plane ID) Plane whose ID is stored in "User Register" 18
: R19 ;(Func ID) Function whose ID is stored in "User Register 19
_Plane_AdjustThatParalax(RegL,RegP,RegO)
_Plane_AdjustThatParalax(RegL,RegP,ConstO)
_Plane_AdjustThatParalax(RegL,ConstP,RegO)
_Plane_AdjustThatParalax(RegL,ConstP,ConstO)
_Plane_AdjustThatParalax(ConstL,RegP,RegO)
_Plane_AdjustThatParalax(ConstL,RegP,ConstO)
_Plane_AdjustThatParalax(ConstL,ConstP,RegO)
_Plane_AdjustThatParalax(ConstL,ConstP,ConstO)
(Description)
#_Plane_AdjustThatParalax(ConstL,RegP,RegO) ;In Plane 0, set the offset of the row/column whose ID is stored in "User Register" 31 to the value stored in "User Register 32"
: 0 ;(PlaneID) Plane 0
: U31 ;(ScrollID) "User Register" 31
: U32 ;(Offset) "User Register" 32
; ----------
#_Plane_AdjustThatParalax(RegL,ConstP,ConstO) ;In the Plane whose ID is stored in "User Register 30", set the offset of row/column 130 to 4096"
: U30 ;(PlaneID) "User Register" 30
: 130 ;(ScrollID) Row/Column 130
:4096 ;(Offset) 4096 pixel offset
_Plane_AdjustThatSingle(RegL,RegO)
_Plane_AdjustThatSingle(RegL,ConstO)
_Plane_AdjustThatSingle(ConstL,RegO)
_Plane_AdjustThatSingle(ConstL,ConstO)
(Description)
#_Plane_AdjustThatSingle(RegL,RegO) ;Set the offset of the flat-scrolling axis of the Plane whose ID is stored in "User Register" 27 to the value stored in "User Register" 28
: U27 ;(PlaneID) "User Register 27"
: U28 ;(Offset) "User Register 28"
; ----------
#_Plane_AdjustThatSingle ;Set the offset of the flat-scrolling axis of Plane 1 to 2048
: 1 ;(PlaneID) Plane 1
:2048 ;(Offset) 2048 pixel offset
_Plane_AdjustThisParalax(RegP,RegO)
_Plane_AdjustThisParalax(RegP,ConstO)
_Plane_AdjustThisParalax(ConstP,RegO)
_Plane_AdjustThisParalax(ConstP,ConstO)
(Description)
#_Plane_AdjustThisParalax(RegP,RegO) ;In the Plane whose "Effect Function" called this command, set the offset of the row/column whose ID is stored in "User Register" 6 to the value stored in "User Register 7"
: U6 ;(ScrollID) "User Register" 6
: U7 ;(Offset) "User Register" 7
; ----------
#_Plane_AdjustThisParalax(ConstP,ConstO) ;In the Plane whose "Effect Function" called this command, set the offset of row/column 50 to 1024
: 50 ;(ScrollID)
:1024 ;(Offset)
_Plane_AdjustThisSingle(RegO)
_Plane_AdjustThisSingle(ConstO)
(Description)
#_Plane_AdjustThisSingle(RegO) ;In the Plane whose "Effect Function" called this command, set the offset of its flat-scrolling axis to the value stored in "User Register 17"
: U17 ;(Offset) "User Register 17"
; ----------
#_Plane_AdjustThisSingle(ConstO) ;In the Plane whose "Effect Function" called this command, set the offset of its flat-scrolling axis to 3072
:3072 ;(Offset)